
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Chance.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Chance)
{
        TEST(should suppport the "Equal" action as P(a) == P(a))
	{
		ASSERT_TRUE(Chance(0.8) == Chance(0.8)); 
	}
        
        TEST(should support the "Not" action as P(b) == !P(a))
	{
		ASSERT_TRUE(Chance(0.8) == !Chance(0.2)); 
	}
        
        TEST(should support the "And" action as P(a)&&P(b) == P(a)*P(b))
	{
		ASSERT_TRUE(Chance(0.16) == Chance(0.8)*Chance(0.2));
	}

        TEST(should support the "Or" action as P(a) || P(b) == P(a)+P(b))
	{
		ASSERT_TRUE(Chance(0.7) ==  Chance(0.5)+Chance(0.2));
	}
};
